/*
 * Dimension.java
 *
 * Created on 2004/02/23 +0900
 *
 * $Revision: 33 $
 * $Date: 2008-07-27 15:31:44 +0000 (Sun, 27 Jul 2008) $
 */

package org.gikolet.framework.ui;

/**
 * @author Tetsutaro (latest modification by $Author: tetsutaro.ss $)
 * @version $Revision: 33 $ $Date: 2008-07-27 15:31:44 +0000 (Sun, 27 Jul 2008) $
 */
public class Dimension {
    private int width;
    private int height;

    public Dimension() {
	this(0, 0);
    }

    public Dimension(Dimension d) {
	this(d.getWidth(), d.getHeight());
    }

    public Dimension(int width, int height) {
	setSize(width, height);
    }

    public void setSize(Dimension d) {
	setSize(d.getWidth(), d.getHeight());
    }

    public void setWidth(int width) {
	setSize(width, getHeight());
    }

    public void setHeight(int height) {
	setSize(getWidth(), height);
    }

    public void setSize(int width, int height) {
	this.width = width;
	this.height = height;
    }

    public Dimension getSize() {
	return new Dimension(this);
    }

    public int getWidth() {
	return this.width;
    }

    public int getHeight() {
	return this.height;
    }

    public String toString() {
	return "width=" + this.width + ": height=" + this.height;
    }
}
